<template>
  <div>
      <el-card class="card">
      <el-row style="text-align: left">
          <h2>就业编辑</h2>
      </el-row>
      <el-row>
          <el-col :span="18">
              <el-row>
                  <el-col :span="3">就业方式</el-col>
                  <el-col :span="6">
                      <el-select v-model="userEmploye.employment" placeholder="请选择">
                        <el-option
                            v-for="(item, index) in employment"
                            :key="index"
                            :label="item.value"
                            :value="item.value">
                        </el-option>
                    </el-select>
                  </el-col>
                  <el-col :span="3"></el-col>
                  <el-col :span="3">用人单位名称</el-col>
                  <el-col :span="6">
                      <el-input
                        placeholder="请输入内容"
                        v-model="userEmploye.company"
                        clearable
                        :disabled="userEmploye.company != null">
                      </el-input>
                  </el-col>
              </el-row>
              <el-row class="padding_row">
                  <el-col :span="3">组织机构代码：</el-col>
                  <el-col :span="6">
                      <el-input
                        placeholder="请输入内容"
                        v-model="userEmploye.organization"
                        clearable>
                      </el-input>
                  </el-col>
                  <el-col :span="3">单位性质：</el-col>
                  <el-col :span="6">
                      <el-select v-model="userEmploye.unitnature" placeholder="请选择">
                        <el-option
                            v-for="(item, index) in unitnature"
                            :key="index"
                            :label="item.value"
                            :value="item.value">
                        </el-option>
                    </el-select>
                  </el-col>
              </el-row>
              <el-row class="padding_row">
                  <el-col :span="3">单位联系人：</el-col>
                  <el-col :span="6">
                      <el-input
                        placeholder="请输入内容"
                        v-model="userEmploye.contactperson"
                        clearable>
                      </el-input>
                  </el-col>
                  <el-col :span="3">单位电话：</el-col>
                  <el-col :span="6">
                      <el-input
                        placeholder="请输入内容"
                        v-model="userEmploye.workphone"
                        clearable
                        :disabled="userEmploye.workphone != null">
                      </el-input>
                  </el-col>
              </el-row>
              <el-row class="padding_row">
                  <el-col :span="3">单位地址：</el-col>
                  <el-col :span="6">
                      <el-input
                        placeholder="请输入内容"
                        v-model="userEmploye.workaddress"
                        clearable>
                      </el-input>
                  </el-col>
                  <el-col :span="3">单位省份：</el-col>
                  <el-col :span="6">
                      <el-input
                        placeholder="请输入内容"
                        v-model="userEmploye.province"
                        clearable
                        :disabled="userEmploye.province != null">
                      </el-input>
                  </el-col>
              </el-row>
              <el-row class="padding_row">
                  <el-col :span="3">邮政编码：</el-col>
                  <el-col :span="6">
                      <el-input
                        placeholder="请输入内容"
                        v-model="userEmploye.postal"
                        clearable>
                      </el-input>
                  </el-col>
                  <el-col :span="3">单位email：</el-col>
                  <el-col :span="6">
                      <el-input
                        placeholder="请输入内容"
                        v-model="userEmploye.workmail"
                        clearable
                        :disabled="userEmploye.workmail != null">
                      </el-input>
                  </el-col>
              </el-row>
              <el-row class="padding_row">
                  <el-col :span="3">职位类别：</el-col>
                  <el-col :span="6">
                      <el-input
                        placeholder="请输入内容"
                        v-model="userEmploye.jobcategories"
                        clearable>
                      </el-input>
                  </el-col>
                  <el-col :span="3">行业类别：</el-col>
                  <el-col :span="6">
                      <el-select v-model="userEmploye.industrycategory" placeholder="请选择">
                        <el-option
                            v-for="(item, index) in industrycategory"
                            :key="index"
                            :label="item.value"
                            :value="item.value">
                        </el-option>
                    </el-select>
                  </el-col>
              </el-row>
              <el-row class="padding_row">
                  <el-col :span="3">就业薪资：</el-col>
                  <el-col :span="6">
                      <el-input
                        placeholder="请输入内容"
                        v-model="userEmploye.salary"
                        clearable>
                      </el-input>
                  </el-col>
                  <el-col :span="12" style="text-align: right;
    padding-right: 25%;"><el-button type="primary" @click="updateUserEmploye">更改</el-button></el-col>
              </el-row>
          </el-col>
      </el-row>
    </el-card>
  </div>
</template>

<script>
export default {
    name: 'userEmploye',
    data() {
        return {
            userEmploye: {},
            employment: [],
            unitnature: [],
            industrycategory: []
        }
    },
    methods: {
        updateUserEmploye() {
            this.userEmploye.uid = localStorage.getItem('uid')
            this.util.post('/user/insertUserComploye', this.userEmploye).then(res => {
                this.$message({
                    message: '恭喜你，更新成功',
                    type: 'success'
                });
            })
        }
    },
    created() {
        this.util.post('/user/loadCodetalbeByName', {name: 'employment'}).then(res => {
            this.employment = res.data
        }),
        this.util.post('/user/selectByPrimaryKey2', {uid: localStorage.getItem('uid')}).then(res => {
            this.userEmploye = res.data
        }),
        this.util.post('/user/loadCodetalbeByName', {name: 'unitnature'}).then(res => {
            this.unitnature = res.data
        }),
        this.util.post('/user/loadCodetalbeByName', {name: 'industrycategory'}).then(res => {
            this.industrycategory = res.data
        })
    }
}
</script>

<style scoped>

.card {
    margin: 20px;
    line-height: 38px;
    position:relative;
	animation:mymove 2s infinite;
	-webkit-animation:mymove 2s infinite; /*Safari and Chrome*/
    animation-iteration-count: 1;
    height: 40pc;
    overflow: scroll;
}

.padding_row {
    margin-top: 20px;;
}
</style>